<?php
/**
* Admin for CMS settings
*
* @author Mario Schillermann <info@rockit-flash.com>
* @encoding UTF-8 äöüßÖÄÜ
* @copyright © 2011 Mario Schillermann (info@rockit-flash.com)
* @license GNU GPL v2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @package Page
* @subpackage Index
* @link $HeadURL$
* @version SVN: $Id$
* @phpVersion >=5
* @todo
*/

class Minipage_Form_Edit extends Zend_Form {
    /**
     * Index
     *
     * @return void $head
     */
    public function build($head, $content)
    {


        $this->setName('minipage');
        $this->addElement(new Zend_Form_Element_Text(
            'title', array('label' => 'Titel')));
        $this->addElement(new Zend_Form_Element_Text(
            'author', array('label' => 'Author')));

        $this->addElement(new Zend_Form_Element_Text(
            'keywords', array('label' => 'Schlüsselwörter')));
        $this->addElement(new Zend_Form_Element_Textarea('description', array('label' => 'Beschreibung')));
        $this->addElement(new Zend_Form_Element_Textarea('text', array('label' => 'Inhalt')));

        //$this->username->addValidator('regex', false, array('/^[a-z]/i'));

        $this->title->setValue($head->title);
        $this->author->setValue($head->meta->author);
        $this->keywords->setValue($head->meta->keywords);
        $this->description->setValue($head->meta->description);
        $this->text->setValue($content);

        $this->addDisplayGroup(
            array(
                'title',
                'author',
                'keywords',
                'description',
                'text'
            ),
            'groups',
            array("legend" => ""));

        return $this;

    }

}